<template>
  <!-- 精选列表 -->
  <div
    class="carefullyChosen_list"
    v-for="(item, index) in RecommendCourseList"
    :key="index"
    @click="toDatelis(item.id)"
  >
    <div class="title">{{ item.course_classify_title }}</div>
    <div class="carefullyChosen-box">
      <div class="carefullyChosen_name">
        {{ item.title }}
      </div>
      <div class="carefullyChosen_img">
        <li v-for="(ele, index) in item.teacher.slice(0, 3)" :key="index">
          <img :src="ele.avatar" alt="" />
          <div class="carefullyChosen_img_name">{{ ele.teacher_name }}</div>
        </li>
      </div>
      <div class="carefullyChosen_footer">
        <div class="footer">
          <div class="enter_num">{{ item.sales_num }}人已报名</div>
          <div :class="item.price == 0 ? 'active_a' : 'active_b'">
            {{ item.price == 0 ? "免费" : "￥" + item.price * 0.01 }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
defineProps({
  RecommendCourseList: Array,
});
const { push } = useRouter();
const toDatelis = (id) => {
  push({
    path: "/LiveDetalis",
    query: { basis_id: id },
  });
};
</script>

<style lang="scss" scoped>
.carefullyChosen_list {
  width: 700px;
  position: relative;
  height: 396px;
  margin: auto;
  box-shadow: 0 0.04rem 0.09333rem 0 hsl(0deg 0% 81%);
  margin-top: 30px;
  border-radius: 20px;
  .title {
    width: 116px;
    height: 50px;
    color: white;
    text-align: center;
    background: url()
      no-repeat;
    background-size: 100% 100%;
    font-size: 20px;
    line-height: 50px;
    left: 0;
    top: 0;
  }
  .carefullyChosen-box {
    padding: 20px;
    height: 100%;
    .carefullyChosen_name {
      font-size: 30px;
    }
    .carefullyChosen_img {
      width: 70%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      margin: 30px;
      li {
        display: flex;
        align-items: center;
        margin-left: 10px;
        img {
          width: 60px;
          height: 60px;
          border-radius: 50px;
        }
        .carefullyChosen_img_name {
          font-size: 20px;
          margin-left: 10px;
        }
      }
    }
    .carefullyChosen_footer {
      position: absolute;
      bottom: 70px;
      left: 20px;
      font-size: 25px;
      margin: auto;
      .footer {
        width: 700px;
        display: flex;
        justify-content: space-between;
        padding: 0 50px;
      }
    }
  }
}
.active_a {
  color: green;
  font-size: 30px;
}
.active_b {
  color: red;
  font-size: 30px;
}
</style>
